<template>
    <!-- <pinpai></pinpai> -->
  <!-- <studentsInfo></studentsInfo> -->
  <div class="main">
    <MyHeader title="购物车"></MyHeader>
    <MyGoods v-for="item in list" :key="item.goods_id" :item="item"></MyGoods>
    <MyFooter :arr="list"></MyFooter>
  </div>
</template>

<script>
// import studentsInfo from './components/studentsInfo.vue';
// import pinpai from './components/pinpai.vue';
import MyHeader from './views/MyHeader.vue';
import MyGoods from './views/MyGoods.vue';
import MyFooter from './views/MyFooter.vue';
import axios from 'axios'
export default {
  data(){
    return{
      list:[]
    }
  },
  components:{
    // studentsInfo
    // pinpai,
    MyHeader,
    MyGoods,
    MyFooter
  },
  async created(){
    const {data:res} = await axios.get('https://applet-base-api-t.itheima.net/api/cart')
    this.list = res.list
  }
}
</script>

<style>
.main{
  padding-top: 45px;
  padding-bottom: 45px;
}
</style>